table.QUERY_PRIMARY_PUT Function

Syntax

<INDEX> as P = Query_Primary_Put(C query_name)

Arguments

query_name

The name of a previously defined query.

Description

Returns existing query if already run, else runs and returns saved query.

The <TBL>.QUERY_PRIMARY_PUT() method runs the saved query specified by Query_Name for the table referenced by the object pointer, <TBL>. The table referenced by <TBL> must be the primary table in the session. It returns the <INDEX> pointer, which will reference either:

a previously created query list that satisfies the query definition, or
an index with the same definition as the query, or
a new query list.

See <TBL>.QUERY_CREATE() for more details on what <INDEX> will reference.

Example

Build a query list using the query defined in the saved query called "Overdue customer accounts".

dim tbl as P
dim indx as P
tbl = table.current()
indx = tbl.query_primary_put("Overdue customer accounts")
rec_count = indx.records_get()
ui_msg_box("", "Number of records selected:" + ltrimrec_count,5,0?)
parent.refresh()

See Also